"DESCRIPTION 1"="With this setting, you can prevent a user from running programs, documents or other files."
"DESCRIPTION 2"="For example, if you want to prevent a program named "setup.exe" from running, simply specify "setup.exe" in this list. When done, trying to double-click the file inside Explorer will result in a nice error message from Windows."
"DESCRIPTION 3"="However, please note that this will only stop the document or program from running when it's started using Windows Explorer (Task Manager -> Run will still work) and the program is exactly named as specified. If the file is renamed, for example to "setup2.exe", Windows can not prevent this application from running as long as you do not specify "setup2.exe" in this list. "
"DESCRIPTION 4"="IMPORTANT: Please note that this setting is not for the entire computer, it's only for the current user! "
"AUTHOR"="Xteq Systems"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Thanks to sanpet.p@bu.ac.th for the idea!"
dim iItems 'contains the total amount of the registry keys
Dim aryItems() 'contains the name of the Registry paths (direct files starting with ".")
Dim aryItemsLoc() 'contains the registry location (\ShellNew or \ShellNew-)
Dim aryDesc() 'contains the description of the items
Sub Plugin_Initialize
iItems=0
Call ReadRegistry
End Sub
Sub ReadRegistry
for l=1 to iItems
Call SetUIElement(l,"")
next
iItems=RegEnumValues(sP)
ReDim aryItems(iItems)
ReDim aryDesc(iItems)
l=1
e=1
sDebug=""
'read all data from the path
For l=1 to iItems
sItem=RegEnumElement(l)
aryItems(l)=sItem
aryDesc(l)=RegReadValue(sP & "\" & sItem)
sDebug=sDebug & sItem
next
'Call DebugMsg(sDebug)
'AND NOW update the UI
for l=1 to iItems
Call SetUIElement(l,aryDesc(l)) 'set data in X-Setup
Next
End Sub
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
bChanged=false
if ElementIndex=1 then 'add
sVal1=InputWindow("Please enter the name of the file that should be disallowed. Please note that you need to specify the extension of the file, for example ┤setup.exe┤ (no quotes)","",1)
If sVal1="" then Exit Sub
'get how many items we already have
iItems=RegEnumValues(sP)
iItems=iItems+1
Call RegWriteValue(sP & "\" & iItems,sVal1,1)
Call RegWriteValue(sP,"1",2)
bChanged=true
else
if ElementSubIndex>0 then
if ElementIndex=2 then 'delete
'sVal1=InputWindow("To delete the selected entry, please press OK","YES",1)
'if sVal1="YES" then
sCurPath=sP & "\" & aryItems(ElementSubIndex)
Call RegDeleteValue(sCurPath)
bChanged=true
'if this was the last entry, reset the REG_DWORD value!
if iItems=1 then
if RegValueExists(sP) then Call RegDeleteValue(sP)
if RegPathExists(sP) then Call RegDeletePath(sP)
end if
'end if
end if
else
Call MsgWarning("Please select an item in the list.")